package com.zhangdy.agent.enums;


public enum RuleEnum {

    BEFORE(0, "before"),
    INSERT(1, "insert"),
    REPLACE(2, "replace"),
    AFTER(3, "after"),

    ;


    private final int rule;
    private final String desc;

    RuleEnum(int rule, String desc) {
        this.rule = rule;
        this.desc = desc;
    }

    public static RuleEnum getByValue(int value){
        for (RuleEnum ruleEnum : values()) {
            if (ruleEnum.getRule() == value) {
                return ruleEnum;
            }
        }
        return null;
    }


    public int getRule() {
        return rule;
    }

    public String getDesc() {
        return desc;
    }
}
